package servlet;

import java.io.IOException;
import java.sql.Date;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import bean.Data;
import dao.DataDao;

public class DayReportServlet extends HttpServlet{

	@Override
	protected void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		// TODO Auto-generated method stub
		doPost(request,response);
	}

	@Override
	protected void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		// TODO Auto-generated method stub
		request.setCharacterEncoding("UTF-8");
		String company_id=request.getParameter("SeltPolluteSource");
		int outlet_id=Integer.parseInt(request.getParameter("SeltDischargePort"));
		String mondate=request.getParameter("TxtSearchDataTime");
		
		DataDao ddao=new DataDao();
		Map<String,Object> map=ddao.findConcetrition(company_id, outlet_id,mondate);
		request.setAttribute("map", map);		
		request.getRequestDispatcher("/statistical form/DayReport.jsp").forward(request, response);
	}

}
